package com.wish.g04.financing.controller;

import com.wish.g04.base.entity.CwCheckBatchDetail;
import com.wish.g04.common.core.web.controller.BaseController;
import com.wish.g04.common.core.web.domain.AjaxResult;
import com.wish.g04.common.core.web.page.TableDataInfo;
import com.wish.g04.financing.dto.CheckBatchDetailDTO;
import com.wish.g04.financing.service.CheckBatchDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 对账批次明细表
 * @author tyd
 * @since 2022-05-28
 */
@RestController
@RequestMapping("/batch_detail")
public class CheckBatchDetailController extends BaseController {

    @Autowired
    private CheckBatchDetailService checkBatchDetailService;

    /**
     * 查询对账名次
     * @param checkBatchDetailDTO
     * @return
     */
    @GetMapping("getBatchDetailList")
    public TableDataInfo getBatchDetailList(CheckBatchDetailDTO checkBatchDetailDTO) {
        startPage();
        List<CwCheckBatchDetail> checkBatchDetailList = checkBatchDetailService.getBatchDetailList(checkBatchDetailDTO);
        return getDataTable(checkBatchDetailList);
    }


    /**
     * 差错处理
     * @param checkBatchDetailDTO
     * @return
     */
    @GetMapping("updateStatus")
    public AjaxResult updateStatus(CheckBatchDetailDTO checkBatchDetailDTO) {
        return AjaxResult.success(checkBatchDetailService.updateStatus(checkBatchDetailDTO));
    }
}
